import request from "@/utils/request";

// 获取居民列表
export function getResidents(params) {
	return request({
		url: "/resident",
		method: "get",
		params,
	});
}

// 获取居民详情
export function getResident(id) {
	return request({
		url: `/resident/${id}`,
		method: "get",
	});
}

// 创建居民
export function createResident(data) {
	return request({
		url: "/resident",
		method: "post",
		data,
	});
}

// 更新居民
export function updateResident(id, data) {
	return request({
		url: `/resident/${id}`,
		method: "put",
		data,
	});
}

// 删除居民
export function deleteResident(id) {
	return request({
		url: `/resident/${id}`,
		method: "delete",
	});
}
